<?php
$this->headTitle('Doanh nghiệp','append');
?>
<div class="dashboard-menu dashboard-admin">
    <span class="back">&nbsp;</span>
    <h1>Doanh nghiệp</h1>

        <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'company','actionName'=>'add'))){ ?>
            <a class="btn btn-danger" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'company', 'action'=>'add'));?>">
                Thêm mới
            </a>
        <?php } ?>                        
</div>
<div class="row placeholders">
    <div class="col-md-12">
        <div class="widget-big">
            <div class="table table-responsive">
                <div class="search-result">
                    <table class="table table-bordetext-danger table-striped table-condensed table-hover" border="0" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr class="warning">
                                <th style="width:10%;">ID</th>
                                <th style="width:20%;">Tên Cty</th>
                                <th style="width:10%;">Liên hệ</th>
                                <th style="width:10%;">Đ.Thoại bàn</th>                                
                                <th style="width:10%;">Di động</th>
                                <th style="width:10%;">T.Khoản sở hữu</th>
                                <th style="width:20%;">Logo</th>
                                <th style="width:10%;">C.Năng</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                            foreach ($this->companyList as $com){
                        ?>
                            <tr>
                                <td style="width:10%;" class="text-left"><?=$com['comId'];?></td>
                                <td style="width:20%;" class="text-left"><?=$com['fullname'];?></td>
                                <td style="width:10%;" class="text-left"><?=$com['contact'];?></td>
                                <td style="width:10%;" class="text-left"><?=$com['phone'];?></td>                                                                                                                                                                                           
                                <td style="width:10%;" class="text-left"><?=$com['mobile'];?></td>
                                <td style="width:10%;" class="text-left">
                                <?php if($com['userId'] != 0)echo $com['userEmail'];else echo"C.Ty Tự do";
                                ?>
                                </td>
                                <td style="width:20%;" class="text-left">
                                    <img src="<?=$com['logo']?>" title="Logo" style="width:100px;height:60px;" onerror="this.onerror=null;this.src='/static/images/noimage.jpg';"/>
                                </td>
                                <td style="width:10%;" class="text-left">
                                <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'company','actionName'=>'edit'))) ?>                                    
                                    <a class="glyphicon glyphicon-pencil" href="<?=$this->url(array('module'=>'admin', 'controller'=>'company', 'action'=>'edit', 'comId'=>$com['comId']))?>" title="Sửa thông tin doanh nghiệp"></a>
                                    &nbsp;&nbsp;                                    
                                <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'company','actionName'=>'delete'))) ?>                                    
                                    <a class="glyphicon glyphicon-remove" href="<?=$this->url(array('module'=>'admin', 'controller'=>'company', 'action'=>'delete', 'comId'=>$com['comId']))?>" title="Xoá doanh nghiệp"></a>                                    
                                </td>
                            </tr>
                        <?php
                            } 
                        ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>